Optimal. Leaf size=63 \[ \frac{a (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac{a B (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0944794, antiderivative size = 63, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.051, Rules used = {3588, 43} \[ \frac{a (B+i A) (c-i c \tan (e+f x))^n}{f n}-\frac{a B (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rule 43
Rubi steps
\begin{align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^n \, dx &=\frac{(a c) \operatorname{Subst}\left (\int (A+B x) (c-i c x)^{-1+n} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left ((A-i B) (c-i c x)^{-1+n}+\frac{i B (c-i c x)^n}{c}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a (i A+B) (c-i c \tan (e+f x))^n}{f n}-\frac{a B (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}\\ \end{align*}
Mathematica [A] time = 3.82473, size = 75, normalized size = 1.19 \[ \frac{i a (c \sec (e+f x))^n (A n+A+B n \tan (e+f x)-i B) \exp (n (-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x))))}{f n (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.347, size = 128, normalized size = 2. \begin{align*}{\frac{i{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}Aa}{f \left ( 1+n \right ) }}+{\frac{i{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}Aa}{fn \left ( 1+n \right ) }}+{\frac{{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}aB}{fn \left ( 1+n \right ) }}+{\frac{iBa\tan \left ( fx+e \right ){{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}}{f \left ( 1+n \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 2.09935, size = 420, normalized size = 6.67 \begin{align*} \frac{{\left ({\left (A - i \, B\right )} a c^{n} n +{\left (A - i \, B\right )} a c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) +{\left ({\left (A + i \, B\right )} a c^{n} n +{\left (A - i \, B\right )} a c^{n}\right )} 2^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) -{\left ({\left (i \, A + B\right )} a c^{n} n +{\left (i \, A + B\right )} a c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) -{\left ({\left (i \, A - B\right )} a c^{n} n +{\left (i \, A + B\right )} a c^{n}\right )} 2^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )}{{\left (-i \, n^{2} +{\left (-i \, n^{2} - i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) +{\left (n^{2} + n\right )} \sin \left (2 \, f x + 2 \, e\right ) - i \, n\right )}{\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac{1}{2} \, n} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.40102, size = 225, normalized size = 3.57 \begin{align*} \frac{{\left ({\left (i \, A - B\right )} a n +{\left (i \, A + B\right )} a +{\left ({\left (i \, A + B\right )} a n +{\left (i \, A + B\right )} a\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac{2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{2} + f n +{\left (f n^{2} + f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (f x + e\right ) + A\right )}{\left (i \, a \tan \left (f x + e\right ) + a\right )}{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]